<template>
  <div id="wrapper">
    <div class="wrapper_content">
      <header id="header">
        <div class="logo_pic"></div>
        <main id="main">
          <div class="content-box">
            <div class="line"></div>
            <div class="content">
              <div class="inner">
                <h1>Tomori</h1>
              </div>
            </div>
            <div class="line"></div>
          </div>

          <nav>
            <div
              v-for="item in navLink"
              :key="item.id"
              @click="$router.push({ name: item.routeName })"
            >
              <span>{{ item.text }}</span>
            </div>
          </nav>
        </main>
      </header>

      <footer id="footer">
        <a>Copyright © 2021 - {{ year }} BeiTa</a>
        <a href="https://beian.miit.gov.cn/" target="_blank">鄂ICP备2023005124号-1</a>
        <a>你在阳光下盛放 而我在阴郁的天空下自得其乐</a>
      </footer>
    </div>
  </div>
</template>

<script>
import logo from 'static/images/logo.png'

function getNavlink() {
  const navLink = [
    {
      id: 0,
      text: '网页访问',
      routeName: 'Home'
    },
    {
      id: 1,
      text: '账号登录',
      routeName: 'Login'
    },
    {
      id: 2,
      text: '账号注册',
      routeName: 'Login'
    },
    {
      id: 3,
      text: '运行状况',
      routeName: 'Home'
    }
  ]
  const year = new Date().getFullYear()

  return {
    navLink,
    year
  }
}

export default {
  name: 'Show',
  setup() {
    return {
      ...getNavlink(),
      logo
    }
  }
}
</script>

<style lang="scss" scoped>
$padding_Y: 48px;
$padding_X: 32px;
$main_color: #fff;
$font_size: 38px;
#wrapper {
  padding: $padding_Y $padding_X;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  .wrapper_content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    &::before {
      display: block;
      content: '';
    }
  }
  #header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    .logo_pic {
      width: 84px;
      height: 84px;
      border: 1.6px solid $main_color;
      border-radius: 50%;
      background: url(../../assets/images/logo.png) no-repeat center;
      background-size: auto 95%;
      // background-size: cover;
    }
  }
  #main {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .content-box {
      @extend #main;
    }
    .content {
      position: relative;
      border-style: solid;
      border-color: $main_color;
      border-width: 1px 0 1px 0;
      .inner {
        overflow: hidden;
        h1 {
          line-height: 0;
          padding: 0 $padding_X;
          margin: auto 0;
          font-size: 38px;
          font-weight: 700;
          opacity: 0;
          animation: open 0.925s forwards;
          color: #fff;
          box-sizing: border-box;
        }
      }
    }
    .line {
      width: 1px;
      height: 57px;
      background-color: $main_color;
    }
    nav {
      display: flex;
      border: 1px solid $main_color;
      border-radius: 4px;
      div {
        cursor: pointer;
        padding: 15px 25px;
        border-right: 1px solid $main_color;
        transition: all 0.25s;
        span {
          font-size: 13px;
          letter-spacing: 3px;
          color: $main_color;
        }
        &:last-child {
          border-right: 0;
        }
        &:hover {
          transition: all 0.25s;
          background-color: rgba(255, 255, 255, 0.075);
        }
      }
    }
  }
  #footer {
    margin-top: 32px;
    width: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
    a {
      color: $main_color;
      font-size: 12px;
      letter-spacing: 3px;
      opacity: 0.75;
      transform: scale(0.8);
      text-transform: uppercase;
      &:last-child {
        transform: scale(1);
      }
    }
  }
}

@keyframes open {
  0% {
    line-height: 0;
    opacity: 0;
    padding: 0 $padding_X;
  }
  100% {
    padding: calc($padding_Y + $font_size / 2) $padding_X;
    opacity: 1;
  }
}
</style>
